#ifndef DEVICEINFO_H
#define DEVICEINFO_H

#include <QWidget>
#include "../MainProject/sqlitedatabase.h"
#include "../MainProject/common.h"

namespace Ui {
class DeviceInfo;
}

class DeviceInfo : public QWidget
{
    Q_OBJECT

public:
    explicit DeviceInfo(QWidget *parent = nullptr);
    ~DeviceInfo();
    Ui::DeviceInfo *getUI();
    void connects();
    QJsonObject readInfo();
signals:
    void sinMainReFlash(const QString querySql="SELECT * FROM devices");
public slots:
    void onSetDeviceId(int);
    void editDeviceInfo();
private:
    Ui::DeviceInfo *ui;
    SQLiteDatabase *db;
    int deviceId;
    Common common;
    QString logText;
};

#endif // DEVICEINFO_H
